Legacy COBOL applications containing embedded SQL statements typically run in mainframes or other hosted environments. For modernization, the legacy applications may be re-hosted within a Java EE application server based upon a Java Virtual Machine (JVM) environment. Such re-hosting may result in an enterprise application comprising of two disparate applications, with one written in a native language such as COBOL, and the other written in Java. For example, a Java application runs as a Java Enterprise Edition (EE) application in a Java EE compliant application server, such as a WebSphere Application Server (WAS), which runs in its own JVM process. The native program is hosted in a separate hosting environment, which runs as a native OS process outside the JVM process. The Java EE application functions as the transaction coordinator and invokes the native application. However, existing art does not invoke the native application within the same transaction context without requiring modification of the native application and uses separate database connections from the two environments. Using separate database connections from the two hosting environments can lead to deadlocks when the applications from the two hosting environments access the same database resource.